console.log("loading: messages.js");
if (window.Messages == undefined) {
	var Messages = {};
};
Messages.Ping = {
	TestEvent : {
		update : "tests.Events.update"
	}
};


Messages.Theme = {
	getItem : function(templateName) {
		return {
			t : "theme.Manager.getItem",
			d : {
				i : templateName
			}
		};
	},
	getItems : function(templates) {
		return {
			t : "theme.Manager.getItems",
			d : {
				i : templates
			}
		};
	}
};

Messages.Common = {
	sessionLock:function(ssid,locale){
		return {
			ssid:ssid,
			locale:locale
		};
	},
	authenticate : function(userId, pwdHash) {
		return {
			user_id : userId,
			pass : pwdHash
		};
	},
	ping : function(ssid, stamp) {
		return {
			ssid : ssid,
			stamp : stamp
		};
	},
	pong : function(ssid, msgs) {
		var msgsO = [ "{" ], f;
		for ( var i in msgs) {
			if (f) {
				msgsO.push(",");
			}
			msgsO.push('"', i, '":', msgs[i]);
			f = true;
		}
		msgsO.push("}");
		return {
			ssid : ssid,
			msgs : msgsO.join('')
		};
	}
};

Messages.UserManager={
		getList:function (off,len,filter){
			return {
				t : "user.Manager.getUsers",
				d : {
					filter:filter,
					off:off,
					len:len
				}
			};
			
		}
};
